package com.cheng.example.util.hutool.crypto;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.crypto.digest.Digester;

/**
 * md5
 */
public class Client01_MD5 {

    public static void main(String[] args) {
        String testStr = "test中文";
//        Digester md5 = new Digester(DigestAlgorithm.MD5);
//        String digestHex = md5.digestHex(testStr);//5393554e94bf0eb6436f240a4fd71282
//        System.out.println(digestHex);
        String md5Hex1 = DigestUtil.md5Hex(testStr);
        System.out.println(md5Hex1);
        System.out.println(md5Hex1.length());

        System.out.println(DigestUtil.md5HexTo16(testStr));


    }
}

